Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pricing modal being cut off and unscrollabel on low resolution screens or when zoomed in #8848

Merged
merged 10 commits into from
Dec 17, 2024

Conversation

khuddite
Copy link
Contributor

@khuddite khuddite commented Dec 3, 2024

Fixes: #7999

  1. Summary
    I am not 100% sure why it's happening, but it seems justify-content: center conflicts with overflow-y: auto and that's why the modal content becomes unscrollable and cut off.

  2. Solution
    To preserve the styling that centers the content inside the modal even when the content height is less than the modal, I moved justify-content: center from the content to the modal container. When the content overflows the modal, it seems justify-content: center does nothing, though.

  3. Screen Recording

CleanShot.2024-12-03.at.09.41.00.mp4

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR fixes a scrolling issue in the pricing modal by adjusting how content centering is handled, ensuring proper scrollability on low-resolution screens.

  • Moved justify-content: center from StyledContent to Modal component in /packages/twenty-front/src/modules/auth/components/AuthModal.tsx
  • Added .justify-center class to StyledMainContainer in /packages/twenty-front/src/modules/ui/layout/page/components/DefaultLayout.tsx for consistent centering
  • Resolved conflict between justify-content: center and overflow-y: auto that was causing content to be cut off
  • Fixed modal scrolling behavior while preserving centered alignment for non-overflowing content

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 68 to 69
flex: 0 1 100%;
overflow: hidden;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: flex: 0 1 100% with overflow: hidden might still cause content clipping in some edge cases. Consider using flex: 1 1 auto instead

@FelixMalfait
Copy link
Member

Pushed a change. What do you think of this solution @khuddite? Do you see any bug/downside with it?

@@ -29,7 +29,8 @@ const StyledModalDiv = styled(motion.div)<{
if (isMobile) return `0`;
return theme.border.radius.md;
}};
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if there is a use case for this right now in the app, but here is what I am thinking.
When the modal has header, content, and footer, previously only content was scrollable meaning the header and footer will be sticky above/below the content. But now, the entire modal is scrollable, meaning the header or footer will be invisible at some point.

I am not sure if we are okay with following that path here. @FelixMalfait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe that diminishes the purpose of the header/footer? IDK

@FelixMalfait FelixMalfait self-assigned this Dec 10, 2024
@FelixMalfait FelixMalfait merged commit 4aabe9e into twentyhq:main Dec 17, 2024
20 checks passed
Copy link

Thanks @khuddite for your contribution!
This marks your 13th PR on the repo. You're top 3% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI Inconsistency on smaller screens - Insufficient Padding for Price Card Title
2 participants